import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'
import 'dayjs/locale/zh-cn';
import locale from 'element-plus/es/locale/lang/zh-cn';
import '@/assets/css/global.less';//全局css样式
import { createPinia } from 'pinia'
import Directives from '@/utils/directives';
import { isMobile } from './utils/busi';

const app = createApp(App)
const pinia = createPinia()
app.use(pinia)
app.use(router)
app.use(Directives)
app.use(ElementPlus, { locale })
app.config.globalProperties.$icons = []
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.config.globalProperties.$icons.push(key)
    app.component(key, component)
}
app.config.globalProperties.$isMobile = isMobile
app.mount('#app')
